package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.demo.entity.Name;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface LogMapper {

     void query(Map a);

    List<Name> getName();

    void insertNames();

    IPage<Name> getPageName(Page<Name> page);

    @Select("select * from user where username=#{username} and password=#{password}")
    List<Map<String,Object>> loginUser(String username, String password);

    Map<String, Object> login(String username, String password);

    @Select("select * from login where username=#{username}")
    Map<String,Object> checkUser(String username);
    @Insert("insert into login (username,password) values(#{username},#{password})")
    void register(String username, String password);
}
